import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/res/colors.dart';
import 'package:ls_work/res/gaps.dart';
import 'package:ls_work/ui/service_order/continue_service_order_widget.dart';
import 'package:ls_work/ui/service_order/finish_service_order_widget.dart';
import 'package:ls_work/ui/service_order/refuse_order_widget.dart';

class FinishServiceOrderHomeViewModel extends BaseViewModel {
  FinishServiceOrderHomeViewModel(BuildContext context) : super(context);

  List<String> get titles => ["服务完成", "继续服务", "拒单"];

  var selection = 0;

  Widget selectTypeWidget() {
    return Column(
      children: [
        Row(
          children: List.generate(
              titles.length,
              (index) => CommonText(titles[index],
                          textColor: index == selection
                              ? Colours.app_main
                              : Color(0xff95989D),
                          textSize: 14,
                          textAlign: TextAlign.center)
                      .addToContainer(
                          padding: EdgeInsets.symmetric(vertical: 10),
                          color: Colors.white)
                      .onTap(() {
                    selection = index;
                    notifyListeners();
                  }).setWeight(1)),
        ),
        Gaps.dividerLine,
        contentWidget(),

      ],
    );
  }

  Widget contentWidget(){
    return Container();
    // switch(selection){
    //   case 0:
    //     return FinishServiceOrderWidget();
    //   case 1:
    //     return ContinueServiceOrderWidget();
    //   case 2:
    //     return RefuseOrderWidget();
    //   default:
    //     return Container();
    // }
  }


}
